package com.acwing.partition35;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/3/12 21:18
 */
public class AC3417砝码称重 {

    private static final int N = 110, M = 200010, B = M / 2;
    private static int[] w = new int[N];
    //f[i][j]表示考虑前i个物品，是否能恰好凑够重量为j
    private static boolean[][] f = new boolean[N][M];
    private static int n, m = 0;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        n = Integer.parseInt(reader.readLine());
        String[] ss = reader.readLine().split(" ");
        for (int i = 1; i <= n; i++) {
            w[i] = Integer.parseInt(ss[i - 1]);
            m += w[i];
        }
        f[0][B] = true;
        for (int i = 1; i <= n; i++) {
            for (int j = -m; j <= m; j++) {
                f[i][j + B] = f[i][j + B] || f[i - 1][j + B];
                if (j - w[i] >= -m) f[i][j + B] |= f[i - 1][j - w[i] + B];
                if (j + w[i] <= m) f[i][j + B] |= f[i - 1][j + w[i] + B];
            }
        }
        int ans = 0;
        for (int i = 1; i <= m; i++) {
            if (f[n][i + B]) ans++;
        }
        writer.write(ans + "\n");
        writer.flush();
    }
}
